package com.example.widgetappone;

import android.content.Intent;
import android.util.Log;

import java.util.Observable;

public class WidgetObservable extends Observable {
    private static WidgetObservable instance = new WidgetObservable();
    public static WidgetObservable getInstance() {
        return instance;
    }

    private WidgetObservable() {
    }
    public void updateValue(Intent intent) {
        Log.d(Constants.DEBUG_TAG, "WidgetObservable updateValue intent =  " + intent + " countObservers = " +  WidgetObservable.getInstance().countObservers());
//        Log.d(Constants.DEBUG_TAG, "updateValue: ");

        synchronized (this) {
            setChanged();
            notifyObservers(intent);
        }
    }
}
